<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> 
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>随便打TCS系统</title>

<!-- Bootstrap -->
<link href="<%=basePath%>vendors/bootstrap/dist/css/bootstrap.min.css"
	rel="stylesheet">

<link
	href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
	rel="stylesheet">

<link href="<%=basePath%>vendors/nprogress/nprogress.css"
	rel="stylesheet">

<link href="<%=basePath%>vendors/iCheck/skins/flat/green.css"
	rel="stylesheet">


<link
	href="<%=basePath%>vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css"
	rel="stylesheet">

<link href="<%=basePath%>vendors/jqvmap/dist/jqvmap.min.css"
	rel="stylesheet" />

<link
	href="<%=basePath%>vendors/bootstrap-daterangepicker/daterangepicker.css"
	rel="stylesheet">

<!-- Custom Theme Style -->
<link href="<%=basePath%>build/css/custom.min.css" rel="stylesheet">
<script src="jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-2.0.0.min.js"></script>
<script src="<%=basePath%>static/js/jquery.gridly.js" type="text/javascript"></script>
<link href="<%=basePath%>static/css/jquery.gridly.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.gridly {
	position: relative;
	width: 960px;
}
</style>

</head>

<body class="nav-md">
	<div class="container body">
		<div class="main_container">
			<div class="col-md-3 left_col">
				<div class="left_col scroll-view">


					<div class="clearfix"></div>
					<br />
				</div>
			</div>

			<!-- page content -->
			<div class="right_col" role="main">
				<div class="">
					<div class="page-title">
						<div class="title_left">
							<h3>八大模块</h3>
						</div>

						<div class="title_right"></div>
					</div>

					<div class="clearfix"></div>

					<div class="row">
						<div class="col-md-12">
							<div class="x_panel">
								<div class="x_title">
									<h2>八大模块更改</h2>
									<ul class="nav navbar-right panel_toolbox">
										<li><a class="collapse-link"> <i
												class="fa fa-chevron-up"></i>
										</a></li>
										<li class="dropdown"><a href="#" class="dropdown-toggle"
											data-toggle="dropdown" role="button" aria-expanded="false">
												<i class="fa fa-wrench"></i>
										</a>
											<ul class="dropdown-menu" role="menu">
												<li><a href="#">Settings 1</a></li>
												<li><a href="#">Settings 2</a></li>
											</ul></li>
										<li><a class="close-link"> <i class="fa fa-close"></i>
										</a></li>
									</ul>
									<div class="clearfix"></div>
								</div>
								<div class="x_content">

									<div class="row">
										<p>
											<input type="submit" class="btn btn-success"
												onclick="content_tianjiabada()" value="添加模块" />
										</p>
									</div>

									<div class="gridly">
									<c:forEach items="${shopinfoes}" var="s" varStatus="z" >
										<div class="col-md-55">
										    <input type="text" value="${s.id}" style="display: none"> 
											<div class="thumbnail">
												<div class="image view view-first">
													<img style="width: 100%; display: block;" src="${s.logo}"
														alt="image" />
													<div class="mask">
														<p>滴滴打人</p>
														<div class="tools tools-bottom">
															<a href="#"><i class="fa fa-arrow-left"></i></a> <a
																href="#"><i class="fa fa-link"></i></a> <a href="#"><i
																class="fa fa-pencil"></i></a> <a href="#" onclick="dongjie('${s.id}')"><i
																class="fa fa-times"></i></a> <a href="#"><i
																class="fa fa-arrow-right"></i></a>
														</div>
													</div>
												</div>
												<div class="caption">
													<p>${s.grade}</p>
													<p>${s.id}</p>
												</div>
											</div>
										</div>
									</c:forEach>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script>
		$('.gridly').gridly();
	</script>
	<script type="text/javascript">
	function content_tianjiabada() {
		location.href = "content_tianjiabada";
	}
	
	function content_xiugaibada(id) {
		location.href = "content_xiugaibada?id=" + id;
	}
	
	function move(thisDiv) {
		var a=$(thisDiv).children("input").val();
		alert(a);
		var b=$(thisDiv).next().children("input").val();
		alert(b);

	}

	$(".col-md-55").mouseup(function(){
		var a=$(this).children("input").val();
		alert(a);
		var b=$(this).next().children("input").val();
		alert(b);
	});

	// ajax 对象
	function ajaxObject() {
		var xmlHttp;
		try {
			// Firefox, Opera 8.0+, Safari
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
			// Internet Explorer
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {
					alert("您的浏览器不支持AJAX！");
					return false;
				}
			}
		}
		return xmlHttp;
	}
	
	function updateUrl(id,url) {
		layui.use(['layer', 'form'], function(){
			  var layer = layui.layer,
			  form = layui.form;

			  layer.prompt({ title: '跳转地址(是否修改)' , value : url ,formType: 3 }, function (pass, index) {
				  var ajax = ajaxObject();
					ajax.open("post", "updateShopinfoes?id=" + id+
						"&url=" + pass, true);
					ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
					ajax.onreadystatechange = function() {
						if (ajax.readyState == 4) {
							if (ajax.status == 200) {
								var result = ajax.responseText;
								if (result == "success") {
									//请求成功
									alert("修改成功");
									location.href = "content_badamokuai";
								} else {
									//请求成功
									alert(result);
									location.href = "content_badamokuai";
								}
							} else {
								//请求失败
								alert("请求终止，请检查操作或联系客服咨询" + ajax.status);
							}
						} else {
						}
					};
					ajax.send();
	            });
		});
	}
	
	function dongjie(id) {
		var ajax = ajaxObject();
		ajax.open("post", "delectShopinfoesTest?id=" + id +
			"&datastatus=" + false, true);
		ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		ajax.onreadystatechange = function() {
			if (ajax.readyState == 4) {
				if (ajax.status == 200) {
					var result = ajax.responseText;
					if (result == "success") {
						//请求成功
						    alert("模块已删除");
							location.href = "content_badatest";
					
					} else {
						//请求成功
						alert(result);
						location.href = "content_badatest";
					}
				} else {
					//请求失败
					alert("请求终止，请检查操作或联系客服咨询" + ajax.status);
				}
			} else {
			}
		};
		ajax.send();
	}
	
	function qianyi(id,grade) {
		 var ajax = ajaxObject();
		 var move = 1 ;
			ajax.open("post", "updateShopinfoes?id=" + id +
					"&grade=" + grade +
					"&move=" + move, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					if (ajax.status == 200) {
						var result = ajax.responseText;
						if (result == "success") {
							//请求成功
							location.href = "content_badamokuai";
						} else {
							//请求成功
							alert(result);
							location.href = "content_badamokuai";
						}
					} else {
						//请求失败
						alert("请求终止，请检查操作或联系客服咨询" + ajax.status);
					}
				} else {
				}
			};
			ajax.send();
	}
	
	function houyi(id,grade) {
		 var ajax = ajaxObject();
		 var move = 2;
			ajax.open("post", "updateShopinfoes?id=" + id +
					"&grade=" + grade +
					"&move=" + move, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.onreadystatechange = function() {
				if (ajax.readyState == 4) {
					if (ajax.status == 200) {
						var result = ajax.responseText;
						if (result == "success") {
							//请求成功
							location.href = "content_badamokuai";
						} else {
							//请求成功
							alert(result);
							location.href = "content_badamokuai";
						}
					} else {
						//请求失败
						alert("请求终止，请检查操作或联系客服咨询" + ajax.status);
					}
				} else {
				}
			};
			ajax.send();
	}
	</script>

	<!-- Bootstrap -->
	<script src="<%=basePath%>vendors/bootstrap/dist/js/bootstrap.min.js"></script>
	<!-- FastClick -->
	<script src="<%=basePath%>vendors/fastclick/lib/fastclick.js"></script>
	<!-- NProgress -->
	<script src="<%=basePath%>vendors/nprogress/nprogress.js"></script>
	<!-- bootstrap-daterangepicker -->
	<script src="<%=basePath%>vendors/moment/min/moment.min.js"></script>
	<script src="<%=basePath%>vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
	<!-- Chart.js -->
	<script src="<%=basePath%>vendors/Chart.js/dist/Chart.min.js"></script>

	<!-- Custom Theme Scripts -->
	<script src="<%=basePath%>build/js/custom.min.js"></script>
	<!-- layui -->
	<script src="<%=basePath%>vendors/layui/layui.js"></script>

</body>
</html>